<div class="box">
	<div class="heading">
		<h1><img src="/assets/admin/book.png" alt="" /><%= t("Borrow") %></h1>
		<div class="buttons"></div>
	</div>
	<div class="content">
		<table class="list">
			<thead>
				<tr>
					<td width="1" style="text-align: center;">
					<input type="checkbox" class="checkall">
					</td>
					<td class="left"><%= t("ID Number") %></td>
					<td class="left"><%= t("Email") %></td>
					<td class="left"><%= t("User Name") %></td>
					<td class="left"><%= t("ID Book") %></td>
					<td class="left"><%= t("Title") %></td>
					<td class="left"><%= t("Borrowed Date") %></td>
					<td class="left"><%= t("Due Date") %></td>
					<td class="left"><%= t("Deposit") %></td>
					<td class="center"><%= t("Action") %></td>
				</tr>
			</thead>
			<tbody>
				<%= form_tag search_manager_borrows_path, :method => :get do %>
				<tr class="search">
					<td></td>
					<td><%= text_field_tag "search_idnumber", nil, :placeholder => 'Enter user\'s id ...',:title =>"Enter user\'s id ..." %></td>
					<td><%= text_field_tag "search_email", nil, :placeholder => 'Enter user\'s email ...',:title =>"Enter user\'s email ..." %></td>
					<td></td>
					<td><%= text_field_tag "search_code", nil, :placeholder => 'Enter book\'s code ...',:title =>"Enter book\'s code ..." %></td>
					<td><%= text_field_tag "search_title", nil , :placeholder => 'Enter book\'s title ...',:title =>'Enter book\'s title ...'%></td>
					<td></td>
					<td></td>
					<td></td>
					<td align="center" style="width:130px;">
					<div style="float:left">
						<%= submit_tag t("Search"), :id => "yt0" %>
					</div> <% end %>
					<%= form_tag delete_multiple_manager_borrows_path, :method => :delete do %>
					<%= submit_tag t("Delete"), :confirm => "Are you sure ?", :id => "yt0" %> </td>
				</tr>
				<% @borrows.each do |borrow| %>
				<% user = borrow.user %>
				<% book = borrow.book %>
				<tr>
					<td style="text-align: center;"> <%= check_box_tag 'borrow_ids[]', borrow.id, false, :class => 'checkbook' %> </td>
					<td class="left"><%= user.idnumber %></td>
					<td class="left"><%= user.email %></td>
					<td class="left" width="150"><%= user.fullname %></td>
					<td class="left"><%= book.code %></td>
					<td class="left"><%= book.title %></td>
					<td class="left"><%= borrow.borrowed_date %></td>
					<td class="left"><%= borrow.return_date %></td>
					<td class="left"><%= borrow.deposit %></td>
					<td class="center"><%= link_to t('Delete'), manager_borrow_path(borrow), :method => :delete, :confirm => "Does '#{user.fullname}' return book: '#{book.title}' ?" %> </td>
				</tr>
				<% end %>
			</tbody>
		</table>
	</div>
</div>
<% end %>